<!DOCTYPE html>


<html lang="zh-CN">


<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    基于Hexo+GitHub_Gitee搭建个人博客 |  寻找那阳光
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/dist/main.css">

  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">

  
<link rel="stylesheet" href="/css/custom.css">

  
  
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

  
  

  

<link rel="alternate" href="/atom.xml" title="寻找那阳光" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    
      
      <canvas width="1777" height="841"
        style="position: fixed; left: 0px; top: 0px; z-index: 99999; pointer-events: none;"></canvas>
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-基于Hexo+GitHub_Gitee搭建个人博客"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  基于Hexo+GitHub_Gitee搭建个人博客
</h1>
 

    </header>
     
    <div class="article-meta">
      <a href="/2021/06/22/%E5%9F%BA%E4%BA%8EHexo+GitHub_Gitee%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time datetime="2021-06-22T12:41:41.578Z" itemprop="datePublished">2021-06-22</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/PersonalBlog/">PersonalBlog</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.1k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">4 分钟</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <blockquote>
<p>自由和山巅上的空气相似，对弱者都是吃不消的。<br>    </p><p align="right">——芥川龙之介 《侏儒的话》。</p><p></p>
</blockquote>
<hr>

<h1 id="预备工作"><a href="#预备工作" class="headerlink" title="预备工作"></a>预备工作</h1><h2 id="1、安装-Node-js"><a href="#1、安装-Node-js" class="headerlink" title="1、安装 Node.js"></a>1、安装 Node.js</h2><p> <a target="_blank" rel="noopener" href="https://nodejs.org/">官网下载链接地址：</a><a target="_blank" rel="noopener" href="https://nodejs.org/">https://nodejs.org</a></p>
<p><font face="楷体">选择当前的LTS版本</font><br><img src="https://img-blog.csdnimg.cn/20210111162259365.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="选择当前的LTS版本"><br><font face="楷体">安装步骤非常简单，一直next，下一步就可以了，默认安装就行。</font></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">node -v		//查看node.js版本，验证是否安装成功</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/2021011116350191.png#pic_center" alt="node.js版本"></p>
<hr>

<h2 id="2、安装-Git"><a href="#2、安装-Git" class="headerlink" title="2、安装 Git"></a>2、安装 Git</h2><p><font face="楷体"> <a target="_blank" rel="noopener" href="https://git-scm.com/downloads">官网下载链接地址：</a><a target="_blank" rel="noopener" href="https://git-scm.com/downloads">https://git-scm.com/downloads</a></font><br><img src="https://img-blog.csdnimg.cn/20210111170302943.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="下载Windows最新版git"><br><font face="楷体">选择当前的最新版本</font></p>
<blockquote>
<p>具体win10下git安装过程参考：<a target="_blank" rel="noopener" href="https://blog.csdn.net/Deng872347348/article/details/111883306">https://blog.csdn.net/Deng872347348/article/details/111883306</a></p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git --version			//查看当前git版本，验证git是否安装成功</span><br></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/20210111171820594.png#pic_center" alt="git版本查看"></p>
<blockquote>
<p><strong>Tips</strong>：这个Git Bash下载下来就相当于Linux中的终端窗口了，以后我们就用这个来打开终端。</p>
</blockquote>
<hr>

<h1 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h1><h2 id="创建blog本地目录"><a href="#创建blog本地目录" class="headerlink" title="创建blog本地目录"></a>创建blog本地目录</h2><p><font face="楷体">新建一个文件夹，比如我这里建了 ==Hexoblog==<br>打开你的文件夹，然后在空白处点鼠标的右键，选择 ==Git Bash Here==</font></p>
<p><font face="楷体">看看 ==node，npm== 是否安装成功，没有成功的就重新安装node。</font><br><img src="https://img-blog.csdnimg.cn/20210111190015814.png#pic_center" alt="node &amp; npm"></p>
<hr>

<h2 id="Node-js换源"><a href="#Node-js换源" class="headerlink" title="Node.js换源"></a>Node.js换源</h2><p><font face="楷体">Node.js 官方源：==<a href="http://registry.npmjs.org==，为避免网络问题，可将其替换为淘宝源：==http://npm.taobao.org==。">http://registry.npmjs.org==，为避免网络问题，可将其替换为淘宝源：==http://npm.taobao.org==。</a></font></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g cnpm --registry=https://registry.npm.taobao.org</span><br></pre></td></tr></table></figure>

<p><font face="楷体">换源后测试cnpm，如果能输出相关介绍，则说明成功了：<code>cnpm </code></font></p>
<p><img src="https://img-blog.csdnimg.cn/20210111191904445.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="cnpm"></p>
<hr>

<h2 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install -g hexo-cli		// 通过npm全局安装hexo</span><br></pre></td></tr></table></figure>
<p><font face="楷体">其中，-g 指定全局安装，之后可以在任意位置使用 hexo 命令</font></p>
<ul>
<li><font face="楷体">验证是否安装成功：<code>hexo -v </code></font></li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20210111192257365.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="hexo"></p>
<ul>
<li><p><font face="楷体">首先看看当前路径：<code>pwd </code></font> </p>
</li>
<li><p><font face="楷体">然后我们运行命令<code>hexo init </code></font>  <font face="楷体">。这步是关键，主要是建立整个项目，这里我博客所在的文件夹（事先创建）名字是Hexoblog，文件夹位置是d盘根目录上。文件目录及其分析如下：</font><br><img src="https://img-blog.csdnimg.cn/20210111193753849.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="hexo init"><br><img src="https://img-blog.csdnimg.cn/20210111193832725.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="项目目录文件生成"><br><img src="https://img-blog.csdnimg.cn/20210111194639505.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="hexo blog目录"></p>
</li>
</ul>
<p> <font face="楷体">其中，目录Hexoblog\source_posts下存放都为makedown（md）格式文件，也就是写好的blog文件。</font></p>
<font color="red">
Notes：也可以在git bash中完成目录创建，步骤如下</font>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo init Hexoblog      <span class="comment"># 初始化创建，会在你所在位置创建 blog 文件夹</span></span><br><span class="line"><span class="built_in">cd</span> Hexoblog             <span class="comment"># 进入 blog 目录</span></span><br><span class="line">npm install         	<span class="comment"># 进一步安装hexo所需文件</span></span><br></pre></td></tr></table></figure>

<hr>

<h2 id="运行测试"><a href="#运行测试" class="headerlink" title="运行测试"></a>运行测试</h2><p> <font face="楷体">这里我们经常用到的有3个命令（第三个仅用于本地测试）</font> </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">hexo clean 		<span class="comment">#用来清理缓存文件</span></span><br><span class="line">hexo g          <span class="comment">#生成文件</span></span><br><span class="line">hexo  s     	<span class="comment">#运行本地服务器</span></span><br><span class="line">hexo  d   		<span class="comment">#上传到服务器</span></span><br></pre></td></tr></table></figure>
<p><font face="楷体">运行</font> <code>hexo s</code></p>
<p><img src="https://img-blog.csdnimg.cn/20210111195441749.png#pic_center" alt="hexo -s"></p>
<p><font face="楷体">接下来输入</font></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean                <span class="comment"># 清除所有记录</span></span><br><span class="line">hexo generate       	  <span class="comment"># 生成静态网页</span></span><br><span class="line">hexo server (-p 80可选)   <span class="comment"># 启动服务, -p 80 表示端口号为 80，默认不加端口号是 4000</span></span><br></pre></td></tr></table></figure>

<p><font face="楷体">然后，使用浏览器访问：<a href="http://localhost:80，就可以看到下面的界面了。">http://localhost:80，就可以看到下面的界面了。</a></font><br><img src="https://img-blog.csdnimg.cn/20210111195514688.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"><br><font face="楷体">至此说明本地环境搭建完成。</font> </p>
<hr>

<h2 id="主题替换"><a href="#主题替换" class="headerlink" title="主题替换"></a>主题替换</h2><blockquote>
<p>默认主题也不是说不好看，就是怕烂大街，谁不想在自己的地盘彰显点个性化呢…</p>
</blockquote>
<p><font face="楷体">官方提供的<a target="_blank" rel="noopener" href="https://hexo.io/themes/">参考主题</a>：<a target="_blank" rel="noopener" href="https://hexo.io/themes/%EF%BC%8C">https://hexo.io/themes/，</a> 这里以<a target="_blank" rel="noopener" href="https://github.com/honjun/hexo-theme-sakura">Sakura主题</a>：<a target="_blank" rel="noopener" href="https://github.com/honjun/hexo-theme-sakura%E4%B8%BA%E4%BE%8B">https://github.com/honjun/hexo-theme-sakura为例</a></font> </p>
<ul>
<li><font face="楷体">进入github点击下载zip：<a target="_blank" rel="noopener" href="https://github.com/honjun/hexo-theme-sakura">https://github.com/honjun/hexo-theme-sakura</a></font></li>
<li><font face="楷体">将压缩包解压，并将其中theme文件夹拷贝至目录<code>Hexoblog/themes</code></font><br><img src="https://img-blog.csdnimg.cn/2021011120263117.jpg#pic_center" alt="sakura.zip"><br><img src="https://img-blog.csdnimg.cn/20210111202701105.jpg#pic_center" alt="unzip"><br><img src="https://img-blog.csdnimg.cn/20210111202725353.jpg#pic_center" alt="themes文件夹"></li>
<li><font face="楷体">修改配置文件：主题配置在Hexoblog主目录找到：_config.yml，记事本打开并修改默认theme: landscape为<code>theme:sakura</code></font></li>
</ul>
<p><img src="https://img-blog.csdnimg.cn/20210111203315140.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="_config.yml"><br><img src="https://img-blog.csdnimg.cn/20210111203332435.jpg#pic_center" alt="Sakura"><br> <font face="楷体">接着，本地测试主题是否替换成功<font></font></font></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo g		//hexo generate</span><br><span class="line">hexo s		//hexo server</span><br></pre></td></tr></table></figure>
<hr>

<h1 id="Gitee配置"><a href="#Gitee配置" class="headerlink" title="Gitee配置"></a>Gitee配置</h1><blockquote>
<p>Gitee配置很简单，简要记录几点。<br>详细参考：<a target="_blank" rel="noopener" href="https://blog.csdn.net/cungudafa/article/details/104260494">https://blog.csdn.net/cungudafa/article/details/104260494</a></p>
</blockquote>
<ul>
<li>新建的仓库名称必须和gitee用户名一致。</li>
<li>每次都需要记得手动更新Gitee端</li>
</ul>
<h2 id="效果图："><a href="#效果图：" class="headerlink" title="效果图："></a>效果图：</h2><p><img src="https://img-blog.csdnimg.cn/20210111215112437.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="giteeblog"></p>
<blockquote>
<p>蛮酷的有没有…</p>
</blockquote>
<hr>

<h1 id="Github配置"><a href="#Github配置" class="headerlink" title="Github配置"></a>Github配置</h1><blockquote>
<p>Github配置大同小异，简要记录几点注意事项。<br>详细参考：<a target="_blank" rel="noopener" href="https://www.jianshu.com/p/f9b213097c42">https://www.jianshu.com/p/f9b213097c42</a></p>
</blockquote>
<ul>
<li><p>出现<font color="red" face="楷体">nothing to commit, working tree clean，且网页404。</font><br><img src="https://img-blog.csdnimg.cn/20210111212745820.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="404"><br>则hexo的提交命令使用：<code>hexo clean && hexo g && hexo d</code></p>
</li>
<li><p>GitHub新建仓库时，仓库名必须为用户名<code>.github.io</code></p>
</li>
<li><p>同时部署GitHub和Gitee的时候，_config_yml中deploy部分如下所示：</p>
</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">  <span class="built_in">type</span>: git</span><br><span class="line">  repo: </span><br><span class="line">        github: git@github.com:用户名/用户名.github.io.git</span><br><span class="line">        gitee: https://gitee.com/用户名/用户名  //因为开启了强制HTTPS</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>
<ul>
<li>GitHub中新建的仓库code中必须要有README.md文件，不然还是会出现404。</li>
<li>内容只有放在在master分支里面的内容才能用github.io查看到</li>
</ul>
<h2 id="效果图"><a href="#效果图" class="headerlink" title="效果图"></a>效果图</h2><p><img src="https://img-blog.csdnimg.cn/20210111215219759.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMwMTIzNjk=,size_16,color_FFFFFF,t_70#pic_center" alt="githubpage"></p>
<hr>
接下来就是自由发挥的空间了，未完待续。。。
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，著作权归作者所有。转载请注明出处！
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2021/06/22/%E5%9F%BA%E4%BA%8EHexo+GitHub_Gitee%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Blog/" rel="tag">Blog</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/GitHub/" rel="tag">GitHub</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Gitee/" rel="tag">Gitee</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hexo/" rel="tag">Hexo</a></li></ul>

    </footer>
  </div>

   
   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "",
    app_key: "",
    path: window.location.pathname,
    avatar: "monsterid",
    placeholder: "给我的文章加点评论吧~",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
   
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2020-2021
        <i class="ri-heart-fill heart_icon"></i> lxsamazing
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        由 <a href="https://hexo.io" target="_blank">Hexo</a> 强力驱动
        <span class="division">|</span>
        主题 - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="寻找那阳光"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/music_player">悦听</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->


<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->


<script src="/js/clickBoom2.js"></script>


<!-- CodeCopy -->


<link rel="stylesheet" href="/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


<script src="/js/dz.js"></script>



    
    <div id="music">
    
    
    
    <iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="52"
        src="//music.163.com/outchain/player?type=2&id=462895657&auto=1&height=32"></iframe>
</div>

<style>
    #music {
        position: fixed;
        right: 15px;
        bottom: 0;
        z-index: 998;
    }
</style>
    
  </div>
</body>

</html>